﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GalaSoft.MvvmLight.Messaging;
using LogWare.Messages;
using LogWare.Model;
using LogWare.Properties;
using LogWare.ViewModel;
using LogWare.Views;

namespace LogWare {
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window {

		public MainWindow() {
			InitializeComponent();
			Messenger.Default.Register<ChildViewMessage<OptionsViewModel>>(this, message => {
				Options opt = new Options();
				bool? result = opt.ShowDialog();
				message.Callback(
					new ChildViewResult<OptionsViewModel> {
						                                      UserAction = result == true ? MessageBoxResult.OK : MessageBoxResult.Cancel,
						                                      UserData = opt.DataContext as OptionsViewModel
					                                      });
			});
		}
	}
}
